package com.tm.test;

import com.tm.util.DBUtil;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

public class SaveStudent {

    private static Connection conn = null;
    private static Statement stmt = null;

    public static void main(String[] args) {
        conn = DBUtil.getConn();

        String sql = "insert into stu values(12,'张三','男',5)";

        try {
            stmt = conn.createStatement();

            int result = stmt.executeUpdate(sql);

            System.out.println(result > 0);

            DBUtil.closeAll(conn, stmt, null);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }
}
